From 1d9888c989e902f0a02c27b7fbcde17da3416da2 Mon Sep 17 00:00:00 2001 From: Alastair Tse Date: Thu, 5 Oct 2006 17:29:19 +0100 Subject: [PATCH] [XEND] Add a convenience function for UUID generation Signed-off-by: Alastair Tse --- tools/python/xen/xend/uuid.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/python/xen/xend/uuid.py b/tools/python/xen/xend/uuid.py index 401540bc6e..7fe52cb335 100644 --- a/tools/python/xen/xend/uuid.py +++ b/tools/python/xen/xend/uuid.py @@ -54,10 +54,6 @@ def getUuidRandom(): uuidFactory = getUuidRandom -def create(): - return uuidFactory() - - def toString(u): return "-".join(["%02x" * 4, "%02x" * 2, "%02x" * 2, "%02x" * 2, "%02x" * 6]) % tuple(u) @@ -65,3 +61,9 @@ def toString(u): def fromString(s): s = s.replace('-', '') return [ int(s[i : i + 2], 16) for i in range(0, 32, 2) ] + +def create(): + return uuidFactory() + +def createString(): + return toString(create()) -- 2.30.2